package cn.tedu;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo01 {
    public static void main(String[] args) {
        try (
                Connection conn = DBUtils.getConn();
        ){
            Statement s = conn.createStatement();
            ResultSet rs = s.executeQuery("select name,sal from emp");
            while (rs.next()){
                String name = rs.getString("name");
                double sal = rs.getDouble("sal");
                System.out.println(name+":"+sal);
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
